package com.yanq.liancar.bean;
/*
 *  @创建者     Administrator
 *  @创建时间   2018/11/15  17:09
 *  @描述       ${TODO}
 */


import android.support.annotation.NonNull;

import java.util.Comparator;
import java.util.List;

public class CarPinpaiBean {


    /**
     * IsSuccess : true
     * OutputMessage : 车的品牌已经全部查出
     * code : null
     * Data : [{"car_brand_id":1,"car_trademark":"奥迪","car_pinyin":"a"},{"car_brand_id":2,"car_trademark":"宝马","car_pinyin":"b"},{"car_brand_id":3,"car_trademark":"奔驰","car_pinyin":"b"},{"car_brand_id":4,"car_trademark":"大众","car_pinyin":"d"},{"car_brand_id":5,"car_trademark":"别克","car_pinyin":"b"},{"car_brand_id":6,"car_trademark":"丰田","car_pinyin":"f"},{"car_brand_id":7,"car_trademark":"福特","car_pinyin":"f"},{"car_brand_id":8,"car_trademark":"劳斯莱斯","car_pinyin":"l"},{"car_brand_id":9,"car_trademark":"法拉利","car_pinyin":"f"}]
     */

    private boolean IsSuccess;
    private String OutputMessage;
    private Object code;
    private List<DataBean> Data;

    public boolean isIsSuccess() {
        return IsSuccess;
    }

    public void setIsSuccess(boolean IsSuccess) {
        this.IsSuccess = IsSuccess;
    }

    public String getOutputMessage() {
        return OutputMessage;
    }

    public void setOutputMessage(String OutputMessage) {
        this.OutputMessage = OutputMessage;
    }

    public Object getCode() {
        return code;
    }

    public void setCode(Object code) {
        this.code = code;
    }

    public List<DataBean> getData() {
        return Data;
    }

    public void setData(List<DataBean> Data) {
        this.Data = Data;
    }


    public static class DataBean implements Comparable<DataBean> {
        /**
         * car_brand_id : 1
         * car_trademark : 奥迪
         * car_pinyin : a
         */

        private int car_brand_id;
        private String car_trademark;
        private String car_pinyin;
        private String image_path;

        public String getImage_path() {
            return image_path;
        }

        public void setImage_path(String image_path) {
            this.image_path = image_path;
        }


        public int getCar_brand_id() {
            return car_brand_id;
        }

        public void setCar_brand_id(int car_brand_id) {
            this.car_brand_id = car_brand_id;
        }

        public String getCar_trademark() {
            return car_trademark;
        }

        public void setCar_trademark(String car_trademark) {
            this.car_trademark = car_trademark;
        }

        public String getCar_pinyin() {
            return car_pinyin;
        }

        public void setCar_pinyin(String car_pinyin) {
            this.car_pinyin = car_pinyin;
        }


        @Override
        public int compareTo(@NonNull DataBean dataBean) {

           if (this.getCar_pinyin().compareTo(dataBean.getCar_pinyin())>0){
               return 1;
           }

            if (this.getCar_pinyin().compareTo(dataBean.getCar_pinyin())<0){
                return -1;
            }

            return 0;
        }
    }
}
